import React, { Component } from 'react'
import request from '../../util/request'
import {Route,Switch,Redirect,NavLink} from 'react-router-dom'
import My from './my'
import Home from './home'
export default class HomeCom extends Component {
    componentDidMount(){
        request.get('/api/list').then(res => {
            console.log(res);
        })
    }
    render() {
        return (
            <div className="wrap">
                <div className="con">
                    <Switch>
                        <Route path="/main/home" component={Home}></Route>
                        <Route path="/main/my" component={My}></Route>
                        <Redirect from="/main" to="/main/home"></Redirect>
                    </Switch>
                </div>
                <footer>
                    <NavLink to="/main/home">圈子</NavLink>
                    <NavLink to="/main/my">我的</NavLink>
                </footer>
            </div>
        )
    }
}
